import request from '../utils/request';//导入帮助类里面的request对象，帮助我们发送请求给后端api接口
import axios from '../utils/request';
//用户列表（用户分页组合查询）
export const getUserList = query => {
    return request({
        url: '/api/Users',
        method: 'get',//get请求用params
        params: query
    });
};
//用户添加
export const addUser = query => {
    return request({
        url: '/api/Users',
        method: 'post',
        data: query
    });
};
//用户删除
export const deleteUser = id => {
    return request({
        url: '/api/Users?id='+id,//路由传参
        method: 'delete',
    });
};
//用户编辑
export const updateUser = query => {
    return request({
        url: '/api/Users',
        method: 'put',
        data: query
    });
};
//根据主键获取用户
export const getUser = id => {
    return request({
        url: '/api/Users'+id,
        method: 'get'
    });
};
//给用户添加角色
export const rolesUser = query => {
    return request({
        url: '/api/Users/AddRoles',
        method: 'post',
        data: query
    });
};

//刷新Token
export const fetchData = query => {
    return request({
        url: '/api/Jwt/JwtToken',
        method: 'get',//get请求用data
        params: query
    });
};